#   -*- mode: makefile; coding: utf-8; -*-
#
#   Copyright 2008 Asier Aguirre <asier.aguirre@gmail.com>
#   This file is part of Intromit.
#
#   Intromit is free software: you can redistribute it and/or modify
#   it under the terms of the GNU General Public License as published by
#   the Free Software Foundation, either version 3 of the License, or
#   (at your option) any later version.
#
#   Intromit is distributed in the hope that it will be useful,
#   but WITHOUT ANY WARRANTY; without even the implied warranty of
#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#   GNU General Public License for more details.
#
#   You should have received a copy of the GNU General Public License
#   along with Intromit.  If not, see <http://www.gnu.org/licenses/>.

LIBTOOL = @LIBTOOL@

nobase_lib_LTLIBRARIES = intromit/frameworks/libintrosight.la

intromit_frameworks_libintrosight_la_LDFLAGS= \
	-lstdc++ -lGL -lGLU -lfreetype
intromit_frameworks_libintrosight_la_LIBADD = \
	../../util/refcnt.lo ../../util/time_queue.lo
intromit_frameworks_libintrosight_la_SOURCES= \
	ogl.cc ogl.hh introsight.cc introsight.hh matrix.cc matrix.hh \
	event_mng.cc event_mng.hh render_mng.cc render_mng.hh \
	render_obj.cc render_obj.hh render_attr.cc render_attr.hh \
	render_params.cc render_params.hh ogl_font.cc ogl_font.hh \
	render_stats.cc render_stats.hh \
	render_obj_frame.cc render_obj_frame.hh \
	render_obj_camera.cc render_obj_camera.hh \
	render_obj_cube.cc render_obj_cube.hh \
	render_obj_widget.cc render_obj_widget.hh \
	render_obj_widget_label.cc render_obj_widget_label.hh \
	render_obj_widget_container.cc render_obj_widget_container.hh \
	render_util.cc render_util.hh \
	key_names.cc key_names.hh

# simple rule to generate metadata info using gendata generator
intromit_FLAGS = -v0 -c ../../../etc/intromit/metadata.cfg \
		 -m ../../generators/gendata/intromit/generators/.libs/
intromit       = ../../intromit/intromit
gendata        = $(patsubst \
			intromit/frameworks/%.la, \
			intromit/frameworks/.libs/%.gendata, \
			$(nobase_lib_LTLIBRARIES))
all-local: $(gendata)
install-exec-local:
	mkdir -p $(prefix)/lib/intromit/frameworks
	for f in $(gendata); do \
		cp ./$$f $(prefix)/lib/intromit/frameworks/; \
	done
%.gendata : %.so
	$(intromit) $(intromit_FLAGS) -o $@ $<

# install shared data
nobase_data_DATA = introsight/fonts/*


INCLUDES = -I../../util -I/usr/include/freetype2

EXTRA_DIST = introsight/fonts

MAINTAINERCLEANFILES =  Makefile.in

clean-local:
	rm -rf *~ *.da *.la intromit
